package io.ooad.ecommerce.commons.domain;

import org.dayatang.domain.BaseEntity;
import org.dayatang.domain.Entity;
import org.dayatang.domain.EntityRepository;
import org.dayatang.domain.InstanceFactory;

import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Version;
import java.io.Serializable;
import java.util.UUID;

/**
 * 实体类的共同基类。系统中
 * Created by yyang on 2016/10/28.
 */
@MappedSuperclass
public class AbstractEntity extends BaseEntity {

    @Id
    private String id = UUID.randomUUID().toString();

    @Version
    private int version;

    public String getId() {
        return id;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

}
